import {autorun, observable} from 'mobx'

const counterStore = observable({
  counter: 0,
  counterStore() {
    this.counter++
  },
  increment() {
    this.counter++
  },

  decrement() {
    this.counter--
  },

  incrementAsync() {
    setTimeout(() => {
      this.counter++
    }, 1000)
  }
})

autorun(() => console.log(counterStore.counter));

export default counterStore
